import axios,{ url } from '.';

export const getAll = async (data) =>{
    let res = await axios({
        method:"get",
        url: url + '/students',
        params:data
    });
    return res.data;
}
export const getById = async (id) =>{
    let res = await axios({
        method:"get",
        url: url + '/students/'+id
    });
    return res.data;
}
export const add = async (data) =>{
    let res = await axios({
        method:"post",
        url: url + '/students',
        data
    });
    return res.data;
}
export const update = async (data) =>{
    let res = await axios({
        method:"put",
        url: url + '/students/' + data._id,
        data
    });
    return res.data;
}
export const del = async (id) =>{
    let res = await axios({
        method:"delete",
        url: url + '/students/' + id
    });
    return res.data;
}